package cn.qzuie.smart.module.dorm.dal.mysql.assettype;

import java.util.*;

import cn.qzuie.smart.framework.common.pojo.PageResult;
import cn.qzuie.smart.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.qzuie.smart.framework.mybatis.core.mapper.BaseMapperX;
import cn.qzuie.smart.module.dorm.dal.dataobject.assettype.AssetDO;
import org.apache.ibatis.annotations.Mapper;
import cn.qzuie.smart.module.dorm.controller.admin.assettype.vo.*;

/**
 * 资产 Mapper
 *
 * @author 吴宗波
 */
@Mapper
public interface AssetMapper extends BaseMapperX<AssetDO> {

    default PageResult<AssetDO> selectPage(AssetPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AssetDO>()
                .likeIfPresent(AssetDO::getName, reqVO.getName())
                .eqIfPresent(AssetDO::getAssetTypeId, reqVO.getAssetTypeId())
                .betweenIfPresent(AssetDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AssetDO::getId));
    }

}